
import org.junit.Before;
import org.junit.Test;

import junit.framework.TestCase;

public class TreeTestJunit extends TestCase {
	
	private TreeImplwork baum;
	
	public  TreeTestJunit()
	{
		
	}
	@Before
	public void setUp()
	{
		baum = new TreeImplwork();
		baum.insert(new Element(4,"Bern"));
		baum.insert(new Element(2,"Z�rich"));
		baum.insert(new Element(17,"Basel"));
		baum.insert(new Element(19,"Genf"));
		baum.insert(new Element(12,"Chur"));
	}
		
	@Test
	public void testCreate()
	{
		
		baum.show();
		baum.delete(17);
		baum.show();
	}
	@Test
	public void testSearch()
	{
		baum.delete(17);
		assertEquals(null,baum.search(77));
		assertEquals("Bern",(baum.search(4)).getName());
		assertEquals("Chur",(baum.search(12)).getName());
		assertEquals(null, baum.search(17));
		
	}

}
